<?php

namespace App\Models;

use Illuminate\Contracts\Auth\MustVerifyEmail;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable;
use Laravel\Sanctum\HasApiTokens;
use App\Scopes\IsDelScope;

class ContentModel extends BaseModel {

    protected static function booted()
    {
        parent::booted();
    }

    protected $connection = 'mysql';
    protected $table = "dtrd_ext_ems_content";
    protected $primaryKey = "content_id";

    const CREATED_AT = null;
    const UPDATED_AT = null;

    protected $hidden = ['is_del'];

    protected $fillable = [
        'title',
        'class_id',
        'time',
        'sequence',
        'status',
        'copyfrom',
        'views',
        'taglink',
        'site',
        'top_mark',
        'view',
        'is_del',
        'course_type',
        'image'
    ];

    public function article()
    {
        return $this->hasOne(ContentArticleModel::class, 'content_id', 'content_id');
    }
}
